<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core" template="template/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgs.usersAndRights}"/>
	</ui:define>
	<ui:define name="bodyInclude">
		<ui:include src="include/menu.xhtml" />
		<p:fieldset legend="#{msgs.users}" toggleable="true">
			<p:outputPanel layout="block" styleClass="container">
				<h:form id="usersForm">
					<p:dataTable currentPageReportTemplate="{currentPage} #{msgs.of} {totalPages}" emptyMessage="#{msgs.emptyDataTableMessage}" id="usersTable" paginator="true" paginatorAlwaysVisible="false" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport}{PageLinks}{NextPageLink} {LastPageLink}" rows="10" rowsPerPageTemplate="5,10,20,50" selection="#{usersAdministrationController.selectedUsers}" value="#{usersAdministrationController.users}" var="user">
						<p:column selectionMode="multiple"/>
						<p:column headerText="#{msgs.name}" sortBy="#{user.name}" styleClass="center">
							<h:outputText value="#{user.name}"/>
						</p:column>
						<p:column headerText="#{msgs.firstName}" sortBy="#{user.lastName}" styleClass="center">
							<h:outputText value="#{user.lastName}"/>
						</p:column>
						<p:column headerText="#{msgs.id}" sortBy="#{user.login}">
							<h:outputText value="#{user.login}"/>
						</p:column>
						<p:column headerText="#{msgs.job}" sortBy="#{user.job}">
							<h:outputText value="#{user.job}"/>
						</p:column>
						<p:column headerText="#{msgs.creationDate}" sortBy="#{user.creationDate}" styleClass="center">
							<h:outputText value="#{user.creationDate}">
								<f:convertDateTime dateStyle="medium" locale="#{localeController.locale}"/>
							</h:outputText>
						</p:column>
						<p:column headerText="#{msgs.administrator}" sortBy="#{user.administrator}" styleClass="center">
							<h:selectBooleanCheckbox disabled="true" value="#{user.administrator}"/>
						</p:column>
						<p:column headerText="#{msgs.responsable}" sortBy="#{user.responsable}" styleClass="center">
							<h:selectBooleanCheckbox disabled="true" value="#{user.responsable}"/>
						</p:column>
						<p:column headerText="#{msgs.actions}" styleClass="center">
							<p:commandButton alt="#{msgs.edit}" image="ui-icon ui-icon-pencil" title="#{msgs.edit}"/>
						</p:column>
					</p:dataTable>
					<p:outputPanel layout="block" styleClass="buttonContainer center">
						<p:commandButton actionListener="#{usersAdministrationController.initUserToCreate}" image="ui-icon ui-icon-circle-plus" oncomplete="dialogUserCreationVar.show()" process="@this" type="submit" value="#{msgs.create}"/>
						<p:commandButton image="ui-icon ui-icon-circle-close" process="@this" value="#{msgs.delete}"/>
					</p:outputPanel>
				</h:form>
			</p:outputPanel>
		</p:fieldset>
		<ui:include src="dialog/dialogUserCreation.xhtml" />
	</ui:define>
</ui:composition>